package sz.com.battleship.game.GameElement;

import java.io.Serializable;
import java.util.Random;

public class Game implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4080231439590444853L;
	private Player player1;
	private Player player2;
	private boolean isStart;
	
	public Game(boolean isAiPlayer) {
		super();
		player1 = new Player();
		if(isAiPlayer){
			player2 = new AiPlayer();
		}
		else{
			player2 = new Player();
		}
	}

	public Player getPlayer1() {
		return player1;
	}

	public Player getPlayer2() {
		return player2;
	}
	public boolean isStart(){
		Random randomGenerator = new Random(System.nanoTime());
		int first = randomGenerator.nextInt(2);
		if(first == 1){
			isStart = true;
			return true;
		}
		return false;
	}
	public void setStart(boolean start){
		isStart = start;
	}
	public boolean getStart(){
		return isStart;
	}

}
